DRDHack - version 1.4
===========================

Version 1.4 (02-18-2006)
------------------------

 * Supporting Edition 5 of DRDXML file specification
   * Formula support (current function set)
   * Mirror pointers
   * Data Type: STRING
   * Global Attributes
   * 32-bit Integers (Unsigned Hex only)
   * LIST element Attribute Presets
   * COMMON Element
   * ITEM element can work like BRA element
   * BRA element treated same as ITEM element
   * Item Attributes:
     * INVAL and OUTVAL (Value Re-Mapping)
     * INTBYTE_INDEXWIDTH
     * ICACHE
   * LEN attribute denotes value arrays, "arr_" datatypes still supported.
   * DECIMAL flag functions with both LIST datatypes and normal datatypes,
     regardless if its found in LIST element or ITEM element.
   * TYPE attribute is optional
 * PAL_15: Gradient and Channel Shuffle effects added.
 * Index Tuner Window: Crash when typing in Input field fixed.
 * Index Tuner Window: Tuning does not Re-load items twice.
 * If file doesnt exist, a warning is given instead of the app crashing.
 * Warning if Read/Write attempted past file range (doesnt just give runtime error and crash)
 * Added some loading/saving hotkeys
 * Item label boxes shows result of formula in case formulas are used.
   (but LAB attributes are not directly editable anymore)
 * Deletion of Items removed for now (didnt work properly anyway)
 * STRING/TBL_STRING datatypes: Auto-Updating feature
 * Byte-remap Configuration Feature
 * BYTE/INT datatypes: MAX attribute decides value's AND-ing when value surpasses Max.
 * Error when DRDXML Includables not found, instead of App break
 * Fix: XML's using Includables can be loaded from folders other than the DRDHack folder.
 * If ARRINDEX_LABDEF attribute is used, the Index label box
   now shows index# number. For both ARRINDEX_LABLIST and ARRINDEX_LABDEF, the number
   is in decimal if the DECINDEX flag is set.
 * XML progress bar more accurate.
 * Pointer calculation better (stops at root of XML tree).
 * Fixed Integer arrays (when INTSIZE set)
 * INTSIZE attribute not cached in memory anymore

Hotkeys
===========================

F5 - Save ROM
F6 - Load/Reload ROM
F7 - Save XML
F8 - Load/Reload XML 

Remap Configurations
===========================
Remap configurations can be used to re-map how DRDHack accesses data in a ROM.
For example.. lets say someone designed an XML for a SNES rom -with- header.
Now, you want to use the XML, but you have a rom -without- header.
Instead of adding a header to the rom, going through the entire XML and correcting
offsets or what.. you can use a remap config. Well, how?
Look in the drdhack.cfg file. It has a field, "remapcfg". It should say
"./remapcfg/default.txt". You can change this to any of the files in the "remapcfg"
sub-folder of DRDHack, or you can make your own config file.
These files can contain one or more formulas that works exactly like DRDXML formulas.
The function "!kptr", returns the pointer to the byte that DRDHack is about to access.
Whatever the formula returns, will be the new pointer that DRDHack uses to access the
byte. Note that these formulas applies to all file access, and are handled for every
single byte that are accessed.

Example:
	"=!kptr + 1" This will make DRDHack access everything 1 byte later than what
	the DRDXML points to.

If a line in the file starts with a ';' it is a comment, if it starts with a '"'
it is a formula. Formulas must also end with the " sign.
Formulas are handled in order from the first to the last.
(After the first formula is handled, the contents of !kptr will be what the first
formula returned)

Look in the already-existing files in the "remapcfg" folder for examples. For
more on formulas, check the DRDXML documentation.

Using PAL_15 Effects
===========================
There are two "selected" color values in the array, the black and the blue.
The black is the color you currently are editing. When applying effects, these two are
used to determine the range of the effect. The black box (selected with left mousebutton) decides the
first color in the array, the blue box (selected with right mousebutton) decides the last one.
Note that colors are ordered horizontally.

Gradient:
---------
 This will create shades, or various shades of transparency betwen the first color and the last color.
 The colors between the first and last are overwritten with the shades from the first to the last
 color. The more towards the first color, the more like the first color. The more towards the right
 color, the more like the last color. Er.. just try it out.

Channel Shuffle:
----------------
 Like it says, this will mix the channels of each color in the range. Under this option there are 9
 checkboxes. The 3 uppermost ones (to the right of "R:"), decides what channels to use as source for
 Red value. The 3 on the next line (to the right of "G:"), decides what channels to use as source for
 Green value. And so on.

If 2 channels are selected as source, it will do the average between those two and use that as source.
If 3 channels are selected as source, it will do the average between the three and use that as source.

Examples:

   R G B 
R: X X X  <-- The average of source Red, Green, and Blue will be used to decide Red result.
G: . . .      Green and Blue results will both be 0.
B: . . .

   R G B
R: X X X  <-- Will make the range greyscale. (The average of source Red, Green and Blue will be put
G: X X X      as the same value in the result Red, Green and Blue)
B: X X X

   R G B
R: . . X  <-- Red result will be Blue source, Blue result will be Red source, Green will remain what it were.
G: . X .
B: X . .

Note on STRING/TBL_STRING Auto-updating
===========================

When the Auto-update check is set, it will write the changes to ROM memory whenever a change is made
to the string. When something is written in, the last character in the string is cut off (its not
written to the ROM memory past the string length). Whenever backspace is used, the second last character
will become what the last character were, and the last character will remain that character. Remember
that when using tables, there might be two or more characters representing each byte in the array.

Known Bugs
===========================
* Title Bar icon is converted to 16-color by VB when changing using HEADICON (ugly, stupid, and no idea why)
  Strangely, icons included and used in TreeView control look just fine.
* The outcome of some things depends on if an Item attribute exist at all. For most attributes, it should work
  so that if a formula exist and returns blank data, it will function equally to if the attribute doesnt exist.
  But not 100% sure it works everywhere.
* Some attributes are cached in memory and not read again until Item is re-loaded. So if they have formulas,
  they might not always work like they should. This goes for attributes:
    MIN
    MAX
  This will be fixed.
* 32-bit Integer support is limited. Things like INVAL and OUTVAL attributes wont work properly with
  32-bit Integers. Due to that VB wont handle 32-bit values raw with various operations, ive made it so
  that the value is split up in two 16-bit values when handling it in memory. This doesnt make everything
  possible, but i dont know any other workaround.

Info
===========================
DRDXML's place on the internet:
http://elazulspad.net/matrixz/drd/drd.htm

Developed by Matrixz (ingegjoestoel@hotmail.com)